/*
 * jxSwing Project (2014)
 * 
 * by Denilson Edinaldo Pinto
 * 
 * LGPL
 * Copyright (C) 2014
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.jxSwing.component.chooser.fileFilter;

import javax.swing.filechooser.FileNameExtensionFilter;

import org.jxUtils.file.type.AudioType;
import org.jxUtils.file.type.CompressType;
import org.jxUtils.file.type.DocumentType;
import org.jxUtils.file.type.DrawingType;
import org.jxUtils.file.type.ExecutableType;
import org.jxUtils.file.type.ImageType;
import org.jxUtils.file.type.PresentationType;
import org.jxUtils.file.type.SimpleTextType;
import org.jxUtils.file.type.SpreadsheetType;
import org.jxUtils.file.type.VideoType;
import org.jxUtils.i18n.I18N;

/**
 * @author Denilson Edinaldo Pinto
 * @porject jxSwing
 * @package org.jxSwing.component.chooser.fileFilter
 * @date 11/03/2014 - 22:16:32
 */
public final class FileFilterFactory {
	
	private static final AudioType AUDIO_TYPE = new AudioType();
	
	private static final CompressType COMPRESS_TYPE = new CompressType();
	
	private static final DocumentType DOCUMENT_TYPE = new DocumentType();
	
	private static final DrawingType DRAWING_TYPE = new DrawingType();
	
	private static final ExecutableType EXECUTABLE_TYPE = new ExecutableType();
	
	private static final ImageType IMAGE_TYPE = new ImageType();
	
	private static final PresentationType PRESENTATION_TYPE = new PresentationType();
	
	private static final SimpleTextType SIMPLE_TEXT_TYPE = new SimpleTextType();
	
	private static final SpreadsheetType SPREADSHEET_TYPE = new SpreadsheetType();
	
	private static final VideoType VIDEO_TYPE = new VideoType();
	
	/**
	 * @return Audio FileFilter
	 */
	public static final FileNameExtensionFilter getAudioFileFilter() {
	
		return getAudioFileFilter(I18N.fileType().audios());
	}
	
	/**
	 * @param description
	 * @return Audio FileFilter
	 */
	public static final FileNameExtensionFilter getAudioFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, AUDIO_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Compress FileFilter
	 */
	public static final FileNameExtensionFilter getCompressFileFilter() {
	
		return getCompressFileFilter(I18N.fileType().compress());
	}
	
	/**
	 * @return Compress FileFilter
	 */
	public static final FileNameExtensionFilter getCompressFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, COMPRESS_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Document FileFilter
	 */
	public static final FileNameExtensionFilter getDocumentFileFilter() {
	
		return getDocumentFileFilter(I18N.fileType().documents());
	}
	
	/**
	 * @return Document FileFilter
	 */
	public static final FileNameExtensionFilter getDocumentFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, DOCUMENT_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Drawing FileFilter
	 */
	public static final FileNameExtensionFilter getDrawingFileFilter() {
	
		return getDrawingFileFilter(I18N.fileType().drawing());
	}
	
	/**
	 * @param description
	 * @return Drawing FileFilter
	 */
	public static final FileNameExtensionFilter getDrawingFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, DRAWING_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Executable FileFilter
	 */
	public static final FileNameExtensionFilter getExecutableFileFilter() {
	
		return getExecutableFileFilter(I18N.fileType().executables());
	}
	
	/**
	 * @return Executable FileFilter
	 */
	public static final FileNameExtensionFilter getExecutableFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, EXECUTABLE_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Imagem FileFilter
	 */
	public static final FileNameExtensionFilter getImageFileFilter() {
	
		return getImageFileFilter(I18N.fileType().images());
	}
	
	/**
	 * @return Imagem FileFilter
	 */
	public static final FileNameExtensionFilter getImageFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, IMAGE_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Presentation FileFilter
	 */
	public static final FileNameExtensionFilter getPresentationFileFilter() {
	
		return getPresentationFileFilter(I18N.fileType().presentation());
	}
	
	/**
	 * @param description
	 * @return Presentation FileFilter
	 */
	public static final FileNameExtensionFilter getPresentationFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, PRESENTATION_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Simple Text FileFilter
	 */
	public static final FileNameExtensionFilter getSimpleTextFileFilter() {
	
		return getSimpleTextFileFilter(I18N.fileType().plainText());
	}
	
	/**
	 * @return Simple Text FileFilter
	 */
	public static final FileNameExtensionFilter getSimpleTextFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, SIMPLE_TEXT_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Spreadsheet FileFilter
	 */
	public static final FileNameExtensionFilter getSpreadsheetFileFilter() {
	
		return getSpreadsheetFileFilter(I18N.fileType().spreadsheet());
	}
	
	/**
	 * @param description
	 * @return Spreadsheet FileFilter
	 */
	public static final FileNameExtensionFilter getSpreadsheetFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, SPREADSHEET_TYPE.getExtensionsWithoutPoint());
	}
	
	/**
	 * @return Video FileFilter
	 */
	public static final FileNameExtensionFilter getVideoFileFilter() {
	
		return getVideoFileFilter(I18N.fileType().videos());
	}
	
	/**
	 * @return Video FileFilter
	 */
	public static final FileNameExtensionFilter getVideoFileFilter(String description) {
	
		return new FileNameExtensionFilter(description, VIDEO_TYPE.getExtensionsWithoutPoint());
	}
}
